<template>
  <div>
    <el-form ref="form" :model="user" label-width="80px" label-position="left" size="mini">
      <el-form-item label="用户名">
        <el-input v-model="user.username" placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input
          v-model="user.password"
          placeholder="请输入密码"
          type="password"
          show-password
        ></el-input>
      </el-form-item>
      <el-form-item align="left">
        <el-button type="primary" ref="form1" @click="fn1()">登入</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10">
      <el-form ref="form" :model="user" label-width="80px" :inline="true">
        <el-form-item label="用户名">
          <el-input
            v-model="user.username"
            placeholder="请输入用户名"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input
            v-model="user.password"
            placeholder="请输入密码"
            type="password"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item align="left">
          <el-button type="primary" ref="form1" @click="fn1()">登入</el-button>
        </el-form-item>
      </el-form>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "Form",
  data() {
    return {
      user: {
        username: "",
        password: "",
      },
    };
  },
  methods: {
    fn1() {
      console.log(this.$refs.form.$el);
    },
  },
};
</script>

<style>
</style>